<template>
	<view class="navigation">
		<view class="left">
			<view class="item" @click="$emit('handLookShop')">
				<u-icon name="home" :size="40" color="#FF365D"></u-icon>
				<view class="text u-line-1">店铺</view>
			</view>
			<view class="item" @click="$emit('navToUstomerService')">
				<u-icon name="server-fill" :size="40"></u-icon>
				<view class="text u-line-1">客服</view>
			</view>
			<view class="item car" @click="$emit('addGoodsCollection')">
				<u-icon color="#FF365D" :name="isCollection==1?'heart-fill':'heart'" :size="40"></u-icon>
				<view class="text u-line-1">收藏</view>
			</view>
		</view>
		<view class="right">
			<u-button type="primary" shape="circle" @click='sub'>立即购买</u-button>
		</view>
	</view>
</template>

<script>
	export default {

		props: {
			isCollection: {
				type: [String, Number],
				default: 0
			}
		},
		methods: {
			sub() {
				this.$emit("submit")
			}
		}
	};
</script>

<style lang="scss" scoped>
	.navigation {
		position: fixed;
		left: 0;
		bottom: 0;
		width: 100%;
		display: flex;
		margin-top: 100rpx;
		justify-content: space-between;
		border: solid 2rpx #f2f2f2;
		background-color: #ffffff;
		padding: 16rpx 30rpx;
		z-index: 9;
		.left {
			display: flex;
			font-size: 20rpx;

			.item {
				margin: 0 30rpx;
				display: flex;
				flex-direction: column;
				align-items: center;

				&.car {
					text-align: center;
					position: relative;

					.car-num {
						position: absolute;
						top: -10rpx;
						right: -10rpx;
					}
				}
			}
		}

		.right {
			display: flex;
			font-size: 28rpx;
			align-items: center;

			.btn {
				line-height: 66rpx;
				padding: 0 30rpx;
				border-radius: 36rpx;
				color: #ffffff;
			}

			.cart {
				background-color: #ed3f14;
				margin-right: 30rpx;
			}

			.buy {
				background-color: #ff7900;
			}
		}
	}
</style>
